package com.example.deal.config;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.example.deal.broker.entity.Deal;

@FeignClient(name = "microservice-deal-cloud",fallback = HystrixFallBackMethod.class)
public interface FeignConfig {

	//第一个坑：使用Feign的时候,如果参数中带有@PathVariable形式的参数,则要用value=""标明对应的参数,否则会抛出IllegalStateException异常
	@GetMapping("/deal/{id}")
	public Deal findById(@PathVariable(value="id") Long id);
}
